package com.edu.app.mapper.core;

import com.edu.app.bean.core.SysListOfValue;
import com.edu.app.util.AppBaseMapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface SysListOfValueMapper extends AppBaseMapper<SysListOfValue> {
    @Select("SELECT * FROM S_LIST_OF_VALUE WHERE ORDER BY TYPE ASC")
    List<SysListOfValue> getAllObject();

    @Select("SELECT * FROM S_LIST_OF_VALUE WHERE TYPE like #{type} ORDER BY SEQUENCE ASC")
    List<SysListOfValue> getObjectListByType(String type);

    @Select("SELECT * FROM S_LIST_OF_VALUE WHERE (type = ${type_condition}) ORDER BY SEQUENCE ASC")
    List<SysListOfValue> getObjectListByMulType(@Param("type_condition") String type_condition);

    @Select("select distinct type from s_list_of_value where type like #{type}")
    List<String> getListOfValueTypeList(@Param("type") String type);
}
